const express = require('express')
const search = express.Router()

// 引入左侧导航栏配置项
const {navlist} = require('../../comfig/navcomfig')

search.get('/navsearch', (req, res) => {
   const {kwd} = req.query
   const target = navlist.find((item) => {
      return item.navtitle.includes(kwd)
   })
   if (target) res.redirect(target.url)
   else res.redirect('/admin/index')
   res.end()
})

module.exports = search